#pragma once

#include <boost/pool/singleton_pool.hpp>

struct NetPool {};

const size_t NetPoolUnitSize = 64;

#define NETPOOL_MALLOC(SIZE) \
    boost::singleton_pool<NetPool, NetPoolUnitSize>::ordered_malloc( \
        (SIZE + NetPoolUnitSize - 1) / NetPoolUnitSize)

#define NETPOOL_FREE(P, SIZE) \
    boost::singleton_pool<NetPool, NetPoolUnitSize>::ordered_free(P, \
        (SIZE + NetPoolUnitSize - 1) / NetPoolUnitSize)
